package com.glorystone.ins.controller;

import com.glorystone.ins.domain.BusinessLog;
import com.glorystone.ins.service.BusinessLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 操作记录
 * @author wangwei
 * @date 2018年3月26日15:11:54
 */
@Controller
@RequestMapping("/log")
public class BusinessLogController {

    @Autowired
    private BusinessLogService businessLogService;


    @RequestMapping("/{businessType}/{businessId}")
    public ResponseEntity<List<BusinessLog>> findAll(@PathVariable("businessType") Integer businessType, @PathVariable("businessId") Long businessId) {


        List<BusinessLog> list = businessLogService.findList(businessType, businessId);
        return new ResponseEntity<>(list, HttpStatus.OK);


    }


}
